import { Config } from "../../Config"
import { Player } from "../core/Player"
import Utils from "../GameUtils"
import { 狙炮 } from "../evolution/狙炮"
import { BaseHandler } from "./BaseHandler"

export class 狙炮Handler extends BaseHandler{

    /** 开炮，一段时间后再计算落点上的大子会不会死，有可能空炮 */
    狙炮_aim(data:any,player:Player) {
        this.handlerMgr.spendAction(player,Config.COST_狙炮_AIM)
        let startPoint = this.gameMgr.map_point.get(data.start)
        let big_start = startPoint.big
        big_start.actionOnce()
        let big_狙炮= startPoint.big as 狙炮
        let endPoint = this.gameMgr.map_point.get(data.end)
        big_狙炮.point_aim = endPoint
        this.gameMgr.sendBroadcast(Utils.getObj("狙炮_aim",{"start":data.start,"end":data.end}))
    }
}